Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forms checkbox to reflect correct model state #738

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

scottyoung
Copy link
Contributor

Issue #, if available:

Description of changes:
Make CheckboxField a controlled component similar to ToggleButton so that the field properly renders a default state of "checked" when it's supposed to.

Update form setting checkbox to checked, and then reload form
https://user-images.githubusercontent.com/1263887/198681650-ed1fb596-4883-414c-a248-c793194a60fd.mov

Current experience, loading form with checkbox in "checked" state does not set it to checked properly
https://user-images.githubusercontent.com/1263887/198681863-de079ca6-ae7b-42fb-8124-3406ba92d164.mov

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@scottyoung scottyoung requested a review from a team as a code owner October 31, 2022 21:08
@codecov-commenter
Copy link

Codecov Report

Merging #738 (22cafee) into tagged-release/forms-hotfix (369e7a9) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@                       Coverage Diff                       @@
##           tagged-release/forms-hotfix     #738      +/-   ##
===============================================================
- Coverage                        91.32%   91.31%   -0.01%     
===============================================================
  Files                              102      102              
  Lines                             3998     3997       -1     
  Branches                          1116     1115       -1     
===============================================================
- Hits                              3651     3650       -1     
  Misses                             325      325              
  Partials                            22       22              
Impacted Files Coverage Δ
...ges/codegen-ui-react/lib/forms/component-helper.ts 96.96% <ø> (ø)
packages/codegen-ui-react/lib/forms/form-state.ts 98.30% <ø> (ø)
packages/codegen-ui-react/lib/workflow/mutation.ts 96.93% <ø> (ø)
...lib/generate-form-definition/helpers/form-field.ts 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 369e7a9...22cafee. Read the comment docs.

@scottyoung scottyoung merged commit 221e8d5 into tagged-release/forms-hotfix Nov 3, 2022
@scottyoung scottyoung deleted the form-checkbox-dynamic-fix branch November 3, 2022 16:53
Jshhhh pushed a commit that referenced this pull request Nov 3, 2022
Co-authored-by: Scott Young <scoyou@amazon.com>
@Jshhhh Jshhhh mentioned this pull request Nov 3, 2022
hein-j pushed a commit that referenced this pull request Nov 3, 2022
Co-authored-by: Scott Young <scoyou@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants